package com.zbl.zblproject.pay.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/11/5
 */
@TableName("zbl_pay_order")
public class PayOrder {

    /**
     * 订单ID
     */
    @TableId()
    private long id;

    /**
     * 门店ID
     */
    private int userId;

    /**
     * 应收账款
     */
    private BigDecimal receivable;

    /**
     * 实收
     */
    private BigDecimal officialReceipts;

    /**
     * 找零
     */
    private BigDecimal changeNote;

    /**
     * 订单支付状态
     * 0.未支付 1.以支付
     */
    private int status;

    /**
     * 支付方式
     *  0: 现金 1:支付宝 2:微信 3:银联
     */
    private int mode;

    /**
     * 打折
     */
    private BigDecimal discount;

    /**
     * 订单创建时间
     */
    private LocalDateTime createTime;

    /**
     * 线上订单号
     */
    private String onlineOrderSn;

    /**
     * 用户的支付宝付款码/微信的付款码
     */
    @TableField(exist = false)
    private String payCode;

    /**
     * 订单项
     */
    @TableField(exist = false)
    private List<PayOrderItem> items;


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public BigDecimal getReceivable() {
        return receivable;
    }

    public void setReceivable(BigDecimal receivable) {
        this.receivable = receivable;
    }

    public BigDecimal getOfficialReceipts() {
        return officialReceipts;
    }

    public void setOfficialReceipts(BigDecimal officialReceipts) {
        this.officialReceipts = officialReceipts;
    }

    public BigDecimal getChangeNote() {
        return changeNote;
    }

    public void setChangeNote(BigDecimal changeNote) {
        this.changeNote = changeNote;
    }

    public int getMode() {
        return mode;
    }

    public void setMode(int mode) {
        this.mode = mode;
    }

    public List<PayOrderItem> getItems() {
        return items;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getOnlineOrderSn() {
        return onlineOrderSn;
    }

    public void setOnlineOrderSn(String onlineOrderSn) {
        this.onlineOrderSn = onlineOrderSn;
    }

    public void setItems(List<PayOrderItem> items) {
        this.items = items;
    }

    public String getPayCode() {
        return payCode;
    }

    public void setPayCode(String payCode) {
        this.payCode = payCode;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    @Override
    public String toString() {
        return "PayOrder{" +
                "receivable=" + receivable +
                ", officialReceipts=" + officialReceipts +
                ", changeNote=" + changeNote +
                ", mode=" + mode +
                '}';
    }
}
